package com.zmj.config;

import com.zmj.interceptor.CustomizeInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zmj
 * @date 2021-08-30 11:20
 */
@Configuration
public class CustomizeWebConfig implements WebMvcConfigurer {

    /**
     * 注册拦截器
     **/
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CustomizeInterceptor())
                .addPathPatterns("/**")//拦截所有包括静态资源
                .excludePathPatterns();//配置排除的路径，如css，js等
    }
}
